﻿using System;
using System.ComponentModel.DataAnnotations.Schema;
using Volo.Abp.Domain.Entities;

namespace HCMS.Entities.Base
{
    /// <summary>
    /// 行政区划
    /// </summary>
    [Table("system_area")]
    public class SystemArea : Entity<int>
    {
        /// <summary>
        /// Id
        /// </summary>
        public new int Id { get; set; }

        /// <summary>
        /// 创建 时间
        /// </summary>
        [Column("create_time")]
        public DateTime CreateTime { get; set; } = DateTime.Now;

        /// <summary>
        /// 创建 人
        /// </summary>
        [Column("create_user")]
        public string CreateUser { get; set; } = "";

        /// <summary>
        /// 更新 时间
        /// </summary>
        [Column("update_time")]
        public DateTime UpdateTime { get; set; } = DateTime.Now;

        /// <summary>
        /// 更新 人
        /// </summary>
        [Column("update_user")]
        public string UpdateUser { get; set; } = "";

        /// <summary>
        /// 状态
        /// </summary>
        [Column("status")]
        public int Status { get; set; }

        /// <summary>
        /// 区域名称
        /// </summary>
        [Column("name")]
        public string Name { get; set; } = "";

        /// <summary>
        /// 行政区划代码
        /// </summary>
        [Column("regionalism_code")]
        public int RegionalismCode { get; set; }

        /// <summary>
        /// 区号
        /// </summary>
        /// <remarks>
        /// 由于 区号 前缀可能有 0，故将类型定义为 字符串
        /// </remarks>
        [Column("area_code")]
        public string AreaCode { get; set; } = "";

        /// <summary>
        /// 邮政编码
        /// </summary>
        [Column("post_code")]
        public int PostCode { get; set; }

        /// <summary>
        /// 区域类型
        /// </summary>
        /// <remarks>
        /// 【1：省、自治区、直辖市】
        /// 【2：地级市、地区、自治州、盟】
        /// 【3：市辖区、县级市、县】
        /// 【4：乡、镇、街道】
        /// </remarks>
        [Column("area_type")]
        public int AreaType { get; set; }

        /// <summary>
        /// 父级 Id
        /// </summary>
        [Column("parent_id")]
        public int ParentId { get; set; }

        /// <summary>
        /// 父级 路径
        /// </summary>
        [Column("parent_path")]
        public string ParentPath { get; set; } = "";

        /// <summary>
        /// 排序号
        /// </summary>
        [Column("orders")]
        public int Orders { get; set; }
    }
}
